package dao.impl;

import com.google.common.collect.ImmutableMap;
import dao.ActiveCouponDao;
import domain.ActiveCoupon;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by aceyin on 15/6/27.
 */
@Repository
public class ActiveCouponDaoImpl extends BaseGenericDao<ActiveCoupon, Integer> implements ActiveCouponDao {
    @Override
    public List<ActiveCoupon> findValidCoupons(long owner) {
        Map<String, Object> params = ImmutableMap.<String, Object>builder().put("account_id", owner).build();
        return queryList("find-valid-coupon-by-user", params);
    }
}
